package com.alibaba.cirtus.ots.application.adapter.ability.model.api;


import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.Valid;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.util.List;
@Data
public class FinishReq implements Serializable {
    private static final long serialVersionUID = -5049010044922515386L;
    @NotEmpty(
            message = "DELIVERY-F-107-00-00-048,单据列表"
    )
    @Size(
            max = 100,
            message = "DELIVERY-F-107-00-00-049,单据列表,100"
    )
    @Valid
    private List<FulfillmentOrderInfo> fulfillmentOrderInfoList;
    @NotBlank(
            message = "DELIVERY-F-107-00-00-048,修改人"
    )
    @Length(
            message = "DELIVERY-F-107-00-00-049,修改人,50",
            max = 50
    )
    private String updater;
    @NotBlank(
            message = "DELIVERY-F-107-00-00-048,来源系统编码"
    )
    @Length(
            message = "DELIVERY-F-107-00-00-049,来源系统编码,50",
            max = 50
    )
    private String fromSys;
    @NotBlank(
            message = "DELIVERY-F-107-00-00-048,业态编码"
    )
    @Length(
            message = "DELIVERY-F-107-00-00-049,业态编码,50",
            max = 50
    )
    private String businessType;
    @NotBlank(
            message = "DELIVERY-F-107-00-00-048,业务单元编码"
    )
    @Length(
            message = "DELIVERY-F-107-00-00-049,业务单元编码,50",
            max = 50
    )
    private String businessUnitCode;



    @Data
    public static class FulfillmentOrderInfo implements Serializable {
        @NotBlank(
                message = "DELIVERY-F-107-00-00-048,履约单号/逆向履约单号"
        )
        @Length(
                message = "DELIVERY-F-107-00-00-049,履约单号/逆向履约单号,50",
                max = 50
        )
        private String fulfillmentOrderNo;
        @NotNull(
                message = "DELIVERY-F-107-00-00-048,履约子单号/逆向履约子单号"
        )
        @Min(
                value = 10L,
                message = "DELIVERY-F-106-00-00-158"
        )
        @Max(
                value = 1000L,
                message = "DELIVERY-F-106-00-00-158"
        )
        private Integer fulfillmentSubOrderNo;
        @Length(
                message = "DELIVERY-F-107-00-00-049,关闭原因,50",
                max = 50
        )
        private String reason;

    }
}
